using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableTransferItemDetail
	{
		public const string Table = "TransferItemDetail";
		public const string TransferItemDetailId = "TransferItemDetailId";
		public const string TransferItemID = "TransferItemID";
		public const string OrdersID = "OrdersID";
		public const string TotalAmount = "TotalAmount";
		public const string ObjectItemId = "ObjectItemId";
		public const string ObjectType = "ObjectType";
		public const string ObjectId = "ObjectId";
	}
	
	[Serializable]
	public class BaseTransferItemDetail
		: IDbSessionEntity, IJsonClass
	{
		int m_TransferItemDetailId;
		/// <summary>
        /// 
        /// </summary>
        public int TransferItemDetailId
        {
            get { return m_TransferItemDetailId; }
            set { m_TransferItemDetailId = value; }
        }
		
		int? m_TransferItemID;
		/// <summary>
        /// 转账项表ID
        /// </summary>
        public int? TransferItemID
        {
            get { return m_TransferItemID; }
            set { m_TransferItemID = value; }
        }
		
		int? m_OrdersID;
		/// <summary>
        /// 订单表ID
        /// </summary>
        public int? OrdersID
        {
            get { return m_OrdersID; }
            set { m_OrdersID = value; }
        }
		
		double m_TotalAmount;
		/// <summary>
        /// 门票转帐金额
        /// </summary>
        public double TotalAmount
        {
            get { return m_TotalAmount; }
            set { m_TotalAmount = value; }
        }
		
		int m_ObjectItemId;
		/// <summary>
        /// 
        /// </summary>
        public int ObjectItemId
        {
            get { return m_ObjectItemId; }
            set { m_ObjectItemId = value; }
        }
		
		int m_ObjectType;
		/// <summary>
        /// 1、门票 2、酒店
        /// </summary>
        public int ObjectType
        {
            get { return m_ObjectType; }
            set { m_ObjectType = value; }
        }
		
		int m_ObjectId;
		/// <summary>
        /// 客房id或者门票id
        /// </summary>
        public int ObjectId
        {
            get { return m_ObjectId; }
            set { m_ObjectId = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_TransferItemDetailId = reader[TableTransferItemDetail.TransferItemDetailId];
            m_TransferItemID = reader[TableTransferItemDetail.TransferItemID];
            m_OrdersID = reader[TableTransferItemDetail.OrdersID];
            m_TotalAmount = reader[TableTransferItemDetail.TotalAmount];
            m_ObjectItemId = reader[TableTransferItemDetail.ObjectItemId];
            m_ObjectType = reader[TableTransferItemDetail.ObjectType];
            m_ObjectId = reader[TableTransferItemDetail.ObjectId];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableTransferItemDetail.TransferItemDetailId, PrimaryKeyType.Identity, TransferItemDetailId);
			writer[TableTransferItemDetail.TransferItemID] = TransferItemID;
			writer[TableTransferItemDetail.OrdersID] = OrdersID;
			writer[TableTransferItemDetail.TotalAmount] = TotalAmount;
			writer[TableTransferItemDetail.ObjectItemId] = ObjectItemId;
			writer[TableTransferItemDetail.ObjectType] = ObjectType;
			writer[TableTransferItemDetail.ObjectId] = ObjectId;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_TransferItemDetailId = idd;
        }
		
		public string TableName
        {
            get { return TableTransferItemDetail.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_TransferItemDetailId = hashToRead["TransferItemDetailId"];
			 
             m_TransferItemID = hashToRead["TransferItemID"];
			 
             m_OrdersID = hashToRead["OrdersID"];
			 
             m_TotalAmount = hashToRead["TotalAmount"];
			 
             m_ObjectItemId = hashToRead["ObjectItemId"];
			 
             m_ObjectType = hashToRead["ObjectType"];
			 
             m_ObjectId = hashToRead["ObjectId"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["TransferItemDetailId"] = TransferItemDetailId;
			 
            hashToFill["TransferItemID"] = TransferItemID;
			 
            hashToFill["OrdersID"] = OrdersID;
			 
            hashToFill["TotalAmount"] = TotalAmount;
			 
            hashToFill["ObjectItemId"] = ObjectItemId;
			 
            hashToFill["ObjectType"] = ObjectType;
			 
            hashToFill["ObjectId"] = ObjectId;
			 
        }

        #endregion
		
	}
}
